<html>
<head><meta charset="utf-8"><title>creating MIR before type check · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html">creating MIR before type check</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="147840742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147840742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147840742">(Nov 16 2018 at 19:41)</a>:</h4>
<blockquote>
<p>you can encode uninferred HIR into MIR without much effort</p>
</blockquote>
<p>certainly not the MIR we have today; I suppose some kind of extended MIR, sure</p>



<a name="147840746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147840746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147840746">(Nov 16 2018 at 19:41)</a>:</h4>
<p>I'm not sure the advantage of this</p>



<a name="147840860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147840860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147840860">(Nov 16 2018 at 19:43)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> so some of the things that MIR (today) needs that you don't know before type-check:</p>
<ul>
<li><code>foo.bar()</code> -- which trait does <code>bar</code> come from?</li>
<li>adjustments like auto-deref, auto-ref, etc</li>
<li>etc etc</li>
</ul>
<p>I've thought about having type check take as input HIR and generate as output HAIR, but this sounds like another route altogether. I'm not sure why it'd be better to this "MIR+" first? Is having the CFG buying you something?</p>



<a name="147840880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147840880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147840880">(Nov 16 2018 at 19:43)</a>:</h4>
<p>(Context is <a href="#narrow/stream/131828-t-compiler/subject/steering.20meeting.202018-11-16/near/147825834" title="#narrow/stream/131828-t-compiler/subject/steering.20meeting.202018-11-16/near/147825834">this message from <span class="user-mention" data-user-id="119009">@eddyb</span> during the steering meeting</a>)</p>



<a name="147841814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147841814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147841814">(Nov 16 2018 at 19:55)</a>:</h4>
<p>I think one positive effect would be that inference runs more naturally on a dataflow graph</p>



<a name="147869731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/creating%20MIR%20before%20type%20check/near/147869731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/creating.20MIR.20before.20type.20check.html#147869731">(Nov 17 2018 at 08:28)</a>:</h4>
<p>you can do NLL inference at the same time, I would think</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>